.resizable {
    flex: 0 0 auto;
    display: flex;

    &--top {
        flex-direction: column-reverse;
    }
    &--left {
        flex-direction: row-reverse;
    }

    $handle-size: 0.35rem;

    &__handle {
        position: relative;

        opacity: 0;
        user-select: none;
        z-index: 1;

        &--right,
        &--left {
            height: 100%;
            width: $handle-size;
            cursor: ew-resize;
            top: 0;
            bottom: 0;
        }
        &--left {
            margin-left: calc(-1 * #{$handle-size});
            right: 0;
        }
        &--right {
            margin-right: calc(-1 * #{$handle-size});
            left: 0;
        }
        &--top {
            width: 100%;
            height: $handle-size;
            margin-bottom: calc(-1 * #{$handle-size});
            cursor: ns-resize;
            top: 0;
            left: 0;
            right: 0;
        }
    }

    &__ghost {
        position: absolute;

        // Add buffer area so that resizables inside a position:relative will continue to receive
        // onMouseMove events even when enlarging in a direction that causes the cursor to be on top
        // of elements in a different position:relative context.
        top: -100px;
        left: -100px;
        right: -100px;
        bottom: -100px;

        display: none;
        z-index: 999999;
        &--resizing {
            display: block;
        }
    }
}

.theme-light {
    .resizable {
        &__handle {
            background-color: $color-light-bg-5;
            &--resizing {
                filter: brightness(0.66);
            }
        }
    }
}
